#ifndef OnlineTrain_H
#define OnlineTrain_H
#include<string>
#include<vector>
#include"ParserOptions.h"
#include"DependencyPipe.h"
#include"DependencyPipe2OSibling.h"
#include"DependencyPipe2OGrandChildren.h"
#include"DependencyPipe2O.h"
#include"DependencyPipe3OGSibling.h"
#include"DependencyPipe3OTSibling.h"
#include"DependencyPipe3O.h"
#include"DependencyPipe4OGTSibling.h"
#include"DependencyDecoder.h"
#include"DependencyDecoder2OSibling.h"
#include"DependencyDecoder2OGrandChildren.h"
#include"DependencyDecoder2O.h"
#include"DependencyDecoder3OGSibling.h"
#include"DependencyDecoder3OTSibling.h"
#include"DependencyDecoder3O.h"
#include"DependencyDecoder4OGTSibling.h"
#include"Parameters.h"

class OnlineTrainer{
public:
	OnlineTrainer(int maxLength, DependencyPipe *pipe, ParserOptions *options, DependencyDecoder *decoder, Parameters *params);
	virtual ~OnlineTrainer();
	virtual void developOnline(std::vector<int> *instanceLengths, std::string *train_forest, int iter, Parameters *params_bk);
	virtual void trainOnline(std::vector<int> *instanceLengths, std::string *train_forest, int iter);
	virtual void developWriteLog(Parameters *params_bk, string *devfile);
	virtual void outputParses(DependencyInstance *instance);

protected:
	int maxLength;
	DependencyPipe *pipe;
	ParserOptions *options;
	DependencyDecoder *decoder;
	Parameters *params;

	vector<vector<vector<double> > > probs;
	vector<vector<vector<vector<double> > > > nt_probs;
};
#endif
